package org.whatever.aha.zjut.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.whatever.aha.zjut.platform.entity.StudentInfo;
import org.whatever.aha.zjut.platform.vo.StudentInfoVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author Baby_mo
 */
public interface StudentInfoMapper extends BaseMapper<StudentInfo> {
        @Select("select * from student_info where user_id = #{userId}")
        StudentInfoVo getStudentInfoVoById(@Param("userId") int userId);

        @Select("select count(*) from student_info where user_id = #{userId}")
        int getStuExist(int userId);

        @Select("select * from student_info where student_number like concat(#{PhoneOrStuNum},'%') or phone_number like concat(#{PhoneOrStuNum},'%')")
        List<StudentInfo> getStuInfoByPhoneOrStuNum(@Param("PhoneOrStuNum") String PhoneOrStuNum);
}
